package com.societyGames.codeAlong.state.codeExercise.model
{
	import flash.utils.Dictionary;
	
	public class ExceptionsData
	{
		private var _data:Dictionary = new Dictionary();
		
		public static function fromXml(xml:XML):ExceptionsData
		{
			var exceptionsData:ExceptionsData = new ExceptionsData();
			for each (var errorXml:XML in xml.error)
			{
				exceptionsData._data[int(errorXml.@id)] = errorXml.toString();	
			}			
			return exceptionsData;
		}
		
		public function match(id:int):String
		{
			return String(this._data[id]);
		}
	}
}